@extends('admin.layout')
@section('title',$title)
@section('content')
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                商品评价管理
                <small>商品评价列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>商品评价管理</a></li>
                <li class="active">商品评价列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">商品评价列表</h3>
                        </div><!-- /.box-header -->
                        <div class="box-body">
                        <form action="/admin/user/index" method="get">

                            @if(session('success'))
                                <div class="alert alert-danger">
                                    {{session('success')}}
                                </div>
                            @endif
                            <div class="form-group">
                                <div class="row">
                                    <div class="col-md-2">
                                         <select name="num" class="form-control">
                                            <option
                                                @if(!empty($request['num']) && $request['num'] == 10)
                                                    selected
                                                @endif
                                            >10</option>
                                            <option
                                                @if(!empty($request['num']) && $request['num'] == 20)
                                                    selected
                                                @endif
                                            >20</option>
                                            <option
                                                @if(!empty($request['num']) && $request['num'] == 50)
                                                    selected
                                                @endif
                                            >50</option>
                                            <option
                                                @if(!empty($request['num']) && $request['num'] == 100)
                                                    selected
                                                @endif
                                            >100</option>
                                        </select>
                                    </div>
                                    <div class="col-md-4 col-md-offset-6">
                                        <div class="input-group input-group-sm">
                                            <input value="{{$request['keywords'] or ''}}" name="keywords" type="text" class="form-control" placeholder="请输入店铺名称">
                                            <span class="input-group-btn">
                                                <button class="btn btn-info btn-flat">搜索</button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                               
                            </div>
                            </form>
                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>店铺名称</th>
                                    <th>商品名称</th>
                                    <th>综合评价</th>
                                    <th>评价内容</th>
                                    <th>评价时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $pingjia)
                                <tr>
                                    <td>{{$pingjia -> id}}</td>
                                    <td>{{$pingjia -> shopname}}</td>
                                    <td>{{$pingjia -> goodname}}</td>
                                    <td>{{$pingjia -> zonghe}}</td>
                                    <td>{!!$pingjia -> content!!}</td>
                                    <td>{{date('Y-m-d',$pingjia -> ptime)}}</td>
                                    <td><a href="/admin/pingjia/edit/{{$pingjia -> id}}">编辑</a> <a href="/admin/pingjia/delete/{{$pingjia -> id}}">删除</td>
                                    
                                </tr>
                                @endforeach
                                </tbody>
                              
                            </table>
                            {!! $data-> appends($request) -> render() !!}
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    
@endsection
